﻿/*
=============================================================================
Author:魏宝辉通过CodeSmithe生成
CreatedTime:2012-12-12
Description:RelationList三层结构数据访问层
=============================================================================
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using PWMIS.DataMap.Entity;
using FTchina.Models;//引入模型层
namespace FTchina.DAL
{
	public static partial class RelationListService
	{
		 
	 
			
		public static int DeleteRelationListById(long id)	
		{     
            RelationList relationList = new RelationList();
            relationList.Id = id;
            EntityQuery<RelationList> query = new EntityQuery<RelationList>(relationList);
             return query.Delete(relationList);
		}	
        
          //以标识列获得对象
        public static RelationList GetRelationListById(long  id)
        {
            RelationList relationList = new RelationList();
            relationList.Id = id;
            EntityQuery<RelationList> query = new EntityQuery<RelationList>(relationList);
            query.FillEntity(relationList);
            return relationList;
        }
		
	 
	 
       
        
        
        
		 
		 
		 public static int AddOrUpdateRelationList(RelationList relationList)
        {
            RelationList _relationList = new RelationList();

            EntityQuery<RelationList> query = new EntityQuery<RelationList>(_relationList);
           _relationList= relationList;
           int i=(relationList.Id==0)?
                 query.Insert(_relationList): query.Update(_relationList);
            return i;
        }
		
		 
	}
}

